package com.bohua.intermediary.controller;

import com.bohua.intermediary.common.Lay;
import com.bohua.intermediary.common.Msg;
import com.bohua.intermediary.entity.SysResources;
import com.bohua.intermediary.service.SysResourcesService;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.annotation.Resource;
/**
 * 控制器
 * @author qian
 * @email 1415261159@qq.com
 * @date 2019/01/19
 */
@Controller
@RequestMapping("/sysResources")
public class SysResourcesController {
    @Resource
    private SysResourcesService sysResourcesService;

    @RequestMapping
    public String sysResources(){
        return "sysResources/sysResources";
    }
    @RequestMapping("/add")
    public String add(){
        return "sysResources/addSysResources";
    }

    @RequestMapping("/update")
    public String update(){
        return "sysResources/updateSysResources";
    }

    @RequestMapping("/getSysResourcess")
    @ResponseBody
    public Lay getSysResourcess(SysResources sysResources,Integer page,Integer limit){
        return sysResourcesService.getSysResourcess(sysResources,page,limit);
    }
    @RequestMapping("/addSysResources")
    @ResponseBody
    public Msg addSysResources(SysResources sysResources){
        return sysResourcesService.addSysResources(sysResources);
    }

    @RequestMapping("/updateSysResources")
    @ResponseBody
    public Msg updateSysResources(SysResources sysResources){
        return sysResourcesService.updateSysResources(sysResources);
    }

    @RequestMapping("/delSysResources")
    @ResponseBody
    public Msg delSysResources(SysResources sysResources){
        return sysResourcesService.delSysResources(sysResources);
    }
}
